import sys
import m3u8dl

# print(len(sys.argv))
if len(sys.argv) != 3 :
	print('请输入m3u8地址和名称')
	exit()

url = sys.argv[1]
name = sys.argv[2]

def downloadCallback(mp4path) :
	print('下载完成:')
	print(mp4path)

if url != None:
	# main.downVideo(url,name)
	md = m3u8dl.M3u8Downloader(downloadCallback)
	md.downloadM3u8(url, name,'./m3u8dlDownloads')
else:
	print('请输入m3u8地址和名称')